package com.jzsec.tzdslog;

import java.sql.Date;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZoneOffset;
import java.time.format.DateTimeFormatter;
import java.time.temporal.Temporal;
import java.time.temporal.TemporalUnit;
import java.util.HashMap;
import java.util.Map;

public class Test {
	public static void main(String[] args) {
		String opStation = "2|clientip:172.16.212.1| | | |mobile:| | | |0| |ver:V4.7.0.01|udid:dbe9df72bd07eee6031c328d45caa087| ";
		String[] arr = opStation.split("\\|");
		for (String s : arr) {
			System.out.println(s);
		}
		Map<String, String> map = new HashMap();
		map.put("opstat_clientip", OpstationUtils.formatIp(arr[1]));
		map.put("mac", OpstationUtils.formatMac(arr[2]));
		map.put("mobilephone", OpstationUtils.formatMobilephone(arr[5]));
		map.put("imei", OpstationUtils.formatImei(arr[10]));
		map.put("udid", OpstationUtils.formatUdid(arr[12]));

		for (Map.Entry<String, String> entry : map.entrySet()) {
			System.out.println(entry.getKey() + " => " + entry.getValue());
		}

		SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		System.out.println(sdf.format(new java.util.Date()).split(" ")[1]);

	}
}
